package run.siyuan.elasticsearch.model;


import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 搜索项
 *
 * @author sjj
 * date 2022年03月28日
 * @date 2022/03/28
 */
@Document(indexName = "search_item")
@Data
public class ItemSearch implements Serializable {
    private static final long serialVersionUID = -1L;
    @Id
    private Long id;

    //@ApiModelProperty("商品id")
    @Field(type = FieldType.Text)
    private Long itemId;

    //@ApiModelProperty("商品名称")
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String name;

    //@ApiModelProperty("商品名称-英语")
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String nameEn;

    //@ApiModelProperty("sku主图")
    private String skuImg;

    //@ApiModelProperty("商品主图")
    private String productImg;

    //@ApiModelProperty("商品skuId")
    @Field(type = FieldType.Keyword)
    private Long skuId;

    /**
     * 卖方身份证
     */
    @Field(type = FieldType.Keyword)
    private Long sellerId;

    /**
     * 卖方名称
     */
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String sellerName;

    /**
     * 商店的名字
     */
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String storeName;

    /**
     * 只做根据skuId搜索用
     */
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String skuIds;

    //@ApiModelProperty("划线价")
    @Field(type = FieldType.Keyword)
    private BigDecimal price;

    //@ApiModelProperty("实际销售价")
    @Field(type = FieldType.Keyword)
    private BigDecimal actualFee;

    //@ApiModelProperty("佣金率")
    private BigDecimal commissionRate;

    //@ApiModelProperty("L1佣金收益")
    private BigDecimal commissionFeeL1;

    //@ApiModelProperty("L2佣金收益")
    private BigDecimal commissionFeeL2;

    //@ApiModelProperty("L3佣金收益")
    private BigDecimal commissionFeeL3;

    //@ApiModelProperty("是否置顶")
    private Integer saleStatus;


    //@ApiModelProperty("基础销量")
    private Integer basicSales;

    //@ApiModelProperty("实际销量")
    private Integer actualSales;

    //@ApiModelProperty("总库存")
    private Integer stock;

    //@ApiModelProperty("剩余库存")
    private Integer surplusStock;

    //@ApiModelProperty("是否售罄")
    private Boolean isSoldOut;

    //@ApiModelProperty("1:商品正常，2：商品已下架，3：商品已售罄，4：礼包商品 (直播)")
    private Integer status;

    //@ApiModelProperty("sku属性")
    private String skuAttr;

    //@ApiModelProperty("sellerType")
    private Integer sellerType;

    //@ApiModelProperty("是否打标")
    private Boolean isLabel;

    //@ApiModelProperty("是否升级礼包商品")
    private Boolean isGift;

    //@ApiModelProperty("是否为YPC_PLUS礼包商品")
    private Boolean isGiftPlus;

    /**
     * 品牌名称
     */
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String brandName;
    /**
     * 品牌名称英文
     */
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String brandNameEn;


    /**
     * 类别名称泰文
     */
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String categoryName;

    /**
     * 类别名称路径
     * 包含泰语使用icu_analyzer
     */
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String categoryNamePath;

    /**
     * 类别名称英文
     */
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String categoryNameEn;
    /**
     * 类别名称在路径
     */
    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String categoryNameEnPath;

    @Field(analyzer = "icu_analyzer", type = FieldType.Text)
    private String categoryPath;

    /**
     * 源 1:youpik
     */
    private Integer source;

    /**
     * 商品类型：1-正常 2-券类商品
     */
    private Integer itemType;

}
